package com.qf.utils;

public class CustomException extends RuntimeException {    //或者继承任何标准异常类
    /**
     *
     */
    private static final long serialVersionUID = 8877916275538560096L;

    private int code = 0;
    public CustomException()  {}                //用来创建无参数对象
    public CustomException(String message) {        //用来创建指定参数对象
        super(message);
    } //调用超类构造器
    public CustomException(String message,int code) {        //用来创建指定参数对象
        super(message);                             //调用超类构造器
        this.code = code;
    }
    public CustomException(String message, Throwable cause) {
        super(message, cause);
    }
    /**错误码**/
    public int getCode() {
        return code;
    }
}
